<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>写字板练习</title>
		<style>
		input[type=button]{
			font-size: 24px;
		}
			#show_area{
				width: 300px;
				height: 300px;
				margin: 20px;
				border: 2px solid black;
			}
		</style>
				<script>
			function inputClick(){
				var showStr = prompt("请输入内容");
				var resultDiv = document.getElementById("output");
				//获取显示区域
				var showDiv = document.getElementById("show_area"); 
				//alert(showStr.length);
				 //写入之前判断
				 //点击取消  showStr是null    点击确定未输入showStr是"字符串的empty"
				 //输入文字长度不为0则显示，js中没有isempty
				 if(showStr.length != 0){
				 	showDiv.innerHTML = showStr;
				 }else{
				 	alert("are you kidding me?");
				 }
				 
				//写入内容
				showDiv.innerHTML = showStr;
			}
		</script>
	</head>
	<body>
		<input type="button" value="请输入内容" onclick="inputClick()"/>
		<div id="show_area"></div>
	</body>
</html>
